#include <stdio.h>
#include <math.h>

int main(void)
{
    int answer[4]={1,3,5,2};
    int guess,a,b,times=0,i,j;
    printf("please guess \n");
    while(a!=4){
        a=0;
        b=0;
        times++;
        printf("%d    :",times);
        scanf("%d",&guess);
        for(i=3;i>-1;i--){
            for(j=0;j<4;j++){
                if((int)(guess/ pow(10,i))==answer[j]){
                    if(i+j==3){
                        a=a+1;
                    }
                    else{
                        b=b+1;
                    }
                }
                guess=guess-(int)(guess/ pow(10,i))* pow(10,i);
            }
            printf("      %DA%dB\n",a,b);
        }
    }
    return 0;
}
